import Layout from '@/views/layout/index'

const advertRouter = {
    path: '/advert',
    component: Layout,
    name: 'ad',
    meta: {
        title: '广告管理',
        icon: 'iconfont icon-zhanghaoguanli'
    },
    redirect: "/advert/manage",
    children: [{
        path: 'manage',
        name: 'advertManage',
        component: () => import('@/views/advert/manage'),
        meta: {
            title: '广告管理',
            api: ['ad'],
            authority: ['list'],
            icon: 'iconfont icon-zhanghaoguanli'
        },
        checkedList: [],
        rights: [{
                value: 'list',
                label: '列表'
            },{
                value: 'create',
                label: '添加'
            },{
                value: 'details',
                label: '详情'
            },{
                value: 'edit',
                label: '编辑'
            },{
                value: 'delete',
                label: '删除'
            }]
    },{
        path: 'position',
        name: 'advertPositionManage',
        component: () => import('@/views/advert/position'),
        meta: {
            title: '广告位管理',
            authority: ['list'],
            api: ['ad_position'],
        },
        checkedList: [],
        rights: [{
                value: 'list',
                label: '列表'
            },{
                value: 'create',
                label: '添加'
            },{
                value: 'details',
                label: '详情'
            },{
                value: 'edit',
                label: '编辑'
            },{
                value: 'delete',
                label: '删除'
            }]
    },{
        path: 'details',
        name: 'advertDetails',
        component: () => import('@/views/advert/details'),
        hidden: true,
        meta: {
            title: '广告详情',
            api: ['ad'],
            authority: ['create','edit','details'],
        }
    },{
        path: 'positionDetails',
        name: 'advertPositionDetails',
        component: () => import('@/views/advert/positionDetails'),
        hidden: true,
        meta: {
            title: '广告位详情',
            api: ['ad_position'],
            authority: ['create','edit','details'],
        }
    }]
}

export default advertRouter